
'
' *  NHibernate 代码模版
' 

Imports System.Collections.Generic

Namespace NCS
	''' <summary>
	'''	
	''' </summary>
	<Serializable()> _
	Public Class SampleAve

		#Region "构造方法"
		Public Sub New()
			m_sessionid = 0
			m_sampleid = 0
			m_c = 0
			m_s = 0
			m_mdate = DateTime.Now
			m_name = Nothing
			m_user = Nothing
			m_methodid = 0
			m_num = 0
			m_cstd = 0

			m_sstd = 0
		End Sub
		#End Region


		#Region "私有变量"
		Private m_sessionid As Integer
		Private m_sampleid As Integer
        Private m_c As Double
        Private m_s As Double
		Private m_mdate As DateTime
		Private m_name As String
		Private m_user As String
		Private m_methodid As Integer
		Private m_num As Short
		Private m_cstd As Double
		Private m_sstd As Double

		#End Region


		#Region "公有属性"

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property sessionid() As Integer
			Get
				Return m_sessionid
			End Get
			Set
				m_sessionid = value
			End Set
		End Property

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property sampleid() As Integer
			Get
				Return m_sampleid
			End Get
			Set
				m_sampleid = value
			End Set
		End Property

		'''<summary>
		'''
		'''</summary>
        Public Overridable Property c() As Double
            Get
                Return m_c
            End Get
            Set(ByVal value As Double)
                m_c = Value
            End Set
        End Property

		'''<summary>
		'''
		'''</summary>
        Public Overridable Property s() As Double
            Get
                Return m_s
            End Get
            Set(ByVal value As Double)
                m_s = Value
            End Set
        End Property

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property mdate() As DateTime
			Get
				Return m_mdate
			End Get
			Set
				m_mdate = value
			End Set
		End Property

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property name() As String
			Get
				Return m_name
			End Get
			Set
				m_name = value
			End Set
		End Property

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property user() As String
			Get
				Return m_user
			End Get
			Set
				m_user = value
			End Set
		End Property

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property methodid() As Integer
			Get
				Return m_methodid
			End Get
			Set
				m_methodid = value
			End Set
		End Property

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property num() As Short
			Get
				Return m_num
			End Get
			Set
				m_num = value
			End Set
		End Property

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property cstd() As Double
			Get
				Return m_cstd
			End Get
			Set
				m_cstd = value
			End Set
		End Property
        '''<summary>
        '''
        '''</summary>
        Public Overridable Property sstd() As Double
            Get
                Return m_sstd
            End Get
            Set(ByVal value As Double)
                m_sstd = value
            End Set
        End Property
        Public Overridable ReadOnly Property crsd() As Double
            Get
                If m_c <> 0 Then
                    Return m_cstd / m_c * 100
                Else
                    Return 0
                End If
            End Get
            'Set(ByVal value As Double)
            'End Set
        End Property
        Public Overridable ReadOnly Property srsd() As Double
            Get
                If m_s <> 0 Then
                    Return m_sstd / m_s * 100
                Else
                    Return 0
                End If
            End Get
            'Set(ByVal value As Double)
            'End Set
        End Property

#End Region

#Region "Rewrite Equals and HashCode"
        ''' <summary>
        ''' 
        ''' </summary>
        Public Overloads Overrides Function Equals(ByVal obj As Object) As Boolean
            If Me Is obj Then
                Return True
            End If
            If (obj Is Nothing) OrElse (obj.[GetType]() IsNot [GetType]()) Then
                Return False
            End If
            Dim castObj As SampleAve = DirectCast(obj, SampleAve)
            Return (castObj IsNot Nothing) AndAlso (m_sampleid = castObj.sampleid)
        End Function
        ''' <summary>
        ''' 用唯一值实现GetHashCode
        ''' </summary>
        Public Overloads Overrides Function GetHashCode() As Integer
            Dim hash As Integer = 57
            hash = 27 * hash * m_sampleid.GetHashCode()
            Return hash
        End Function
#End Region
    End Class
End Namespace
